package com.example.custom.mybatis.web.resources;
/**
 * Copyright (c) 2018-2022 ThunderSoft
 * All Rights Reserved by Thunder Software Technology Co., Ltd and its affiliates.
 * You may not use, copy, distribute, modify, transmit in any form this file
 * except in compliance with ThunderSoft in writing by applicable law.
 */


import com.example.custom.mybatis.entity.Userinfo;
import com.example.custom.mybatis.service.UserinfoService;
import com.example.custom.mybatis.service.impl.UserinfoServiceImpl;

import java.util.List;

/**
 * @author liyuncong
 * @version 1.0
 * @file UserinfoResource
 * @brief UserinfoResource
 * @details UserinfoResource
 * @date 2022-11-13
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2022-11-13               liyuncong          Created
 */
public class UserinfoResource {

    public static void main(String[] args) {
//        testSelect();
        testInsert();
    }

    public static void testSelect() {
        UserinfoService userinfoService = new UserinfoServiceImpl();
        final List<Userinfo> userinfos = userinfoService.findAllByUsername("zhangsan");
        System.out.println(userinfos);
    }

    public static void testInsert() {
        UserinfoService userinfoService = new UserinfoServiceImpl();
        final Userinfo userinfo = new Userinfo(10, "sunwukong", 22, 0);
        final boolean saved = userinfoService.insert(userinfo);
        System.out.println(saved);
    }
}
